<template>
	<view class="container-shop"
		style="background: #f7f7f7">
		<scroll-view scroll-y="true" class="main">
			<swiper class="swiper" circular indicator-dots autoplay :interval="5000" indicator-active-color="#fff"
				:duration="500" style="height: 480rpx;">
				<swiper-item v-for="item in  detailInfo.images.split(',')" :key="item">
					<view class="" style="height: 100%;">
						<image style="width: 100%;height: 100%" :src="$fun.imgUrl(item)" mode=""></image>
					</view>
				</swiper-item>
			</swiper>
			<view class="shopBox">
				<view class="top">
					<view class="price-box">
						<view class="price">
							<text class="price-num">{{detailInfo.money}}</text>
						</view>
						<view class="browse">
							{{$t('shop.name1')}}：{{detailInfo.num}}
						</view>
					</view>
					<view class="title">
						<text>{{detailInfo.name}}</text>
					</view>
				</view>
				<view class="guarantee">
					<view class="left">
						{{$t('shop.name3')}}
					</view>
					<view class="">
						{{$t('shop.name4')}}
					</view>
					<view class="" style="margin-left: 50rpx;">
						{{$t('shop.name5')}}：{{detailInfo.stock}}
					</view>
				</view>
				<view class="shopList">
					<view class="" v-html="detailInfo.content" v-if="tabIndex==0"></view>
				</view>
			</view>
			
		</scroll-view>
		<view class="footer">
			<view class="btn" @click="handleNext">
				{{$t('shop.name6')}}
			</view>
				
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imageList: [],
				detailInfo: {},
				tabList: [{
					name: this.$t('shop.name7')
				}, {
					name: this.$t('shop.name8')
				}],
				tabIndex: 0,
			};
		},
		onShow() {

		},
		// 分享好友
		onShareAppMessage() {
			return {
				title: 'smartbox',
				path: JSON.parse(uni.getStorageSync('gitH5Qrcode')),
			}
		},
		// 分享朋友圈
		onShareTimeline() {
			return {
				title: 'smartbox',
				query: JSON.parse(uni.getStorageSync('gitH5Qrcode')),
			}
		},
		async onLoad({
			ids
		}) {
			uni.setNavigationBarTitle({
				title:this.$t('otc.name33')
			})
			const res = await this.$fun.ajax.post('goods/getInfo', {
				ids: ids
			})
			if (res.code == 1) {
				this.detailInfo = res.data
			}

		},
		methods: {
			changeTab(index) {
				this.tabIndex = index
			},
			handleback() {
				this.$fun.jump('/pages/index/index')
			},
			handleNext() {
				this.$fun.jump(`/pageB/createOrder?id=${this.detailInfo.id}`)
			}
		}
	}
</script>

<style lang="scss">
	page {
		height: 100%;
	}

	.container-shop {
		height: 100%;


		.main {
			height: 100%;
		}
	}

	.content {
		.inform {
			margin: 20rpx 30rpx;

			.inform-info {
				display: flex;
				padding: 0 20rpx;
				height: 50rpx;
				border-radius: 10rpx;

				.picture {
					display: flex;
					align-items: center;
					margin-right: 30rpx;

					image {
						width: 34rpx;
						height: 34rpx;
					}
				}

				.info {
					width: 80%;
					height: 100%;

					.swiper {
						height: 500rpx;
						width: 100%;
						// height: 100%;

						.swiper-item {
							display: flex;
							align-items: center;
							width: 100%;
							height: 500rpx;

							img {
								height: 500rpx;
							}

							text {
								font-size: 24rpx;
								color: #333333;
							}
						}
					}
				}
			}
		}

		.classList {
			padding: 20rpx 0;
			margin: 30rpx 50rpx;

			.classItem {
				width: 20%;
				display: flex;
				margin-bottom: 20rpx;
				flex-direction: column;
				align-items: center;

				image {
					width: 104rpx;
					height: 104rpx;
				}

				.text {
					margin-top: 10rpx;
					color: #333333;
					font-size: 24rpx;
					font-family: Microsoft YaHei
				}
			}
		}

		.businessList {
			margin-top: 40rpx;

			.businessItem {
				margin-bottom: 20rpx;
				height: 170rpx;
				// background: #FFFFFF;
				box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(0, 0, 0, 0.1);
				border-radius: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.l {
					margin-left: 30rpx;
					height: 100%;
					display: flex;
					align-items: center;

					image {
						width: 110rpx;
						height: 110rpx;
					}

					.text_info {
						margin-left: 30rpx;
						display: flex;
						flex-direction: column;
						justify-content: center;

						.title {
							font-size: 28rpx;
							font-family: Microsoft YaHei;
							font-weight: bold;
							color: #333333;
						}

						.text {
							margin-top: 8rpx;
							color: #333333;
							font-size: 24rpx;
						}

					}
				}

				.r {
					margin-right: 27rpx;
					width: 150rpx;
					height: 60rpx;
					// background: #FFFFFF;
					border: 2rpx solid #1D93FF;
					border-radius: 30rpx;
					font-size: 28rpx;
					font-family: Microsoft YaHei;
					color: #1D93FF;
					text-align: center;
					line-height: 60rpx;
				}
			}
		}
	}

	.shopBox {
		padding: 20rpx 30rpx;
		background: #F5F9FF;
		border-radius: 30px 30px 0 0;
		.top{
			background: #FFFFFF;
			border-radius: 30rpx 30rpx;
			margin-top: -30rpx;
			padding: 15rpx;
		}
		.price-box {
			display: flex;
			justify-content: space-between;
			align-items: center;
			// background-color: #fff;
			padding: 0rpx 15rpx;

			.price {
				font-size: 40rpx;
				color: #fa1418;

				.price-num {
					font-size: 64rpx;
					font-family: DIN, DIN;
					font-weight: bold;
					color: #fa1418;
				}

			}

			.browse {
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #999999;

			}
		}
		.title {
			text {
				font-size: 32rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				color: #232323;
				overflow: hidden;
				-webkit-line-clamp: 2;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-box-orient: vertical;
			}
		
			padding: 10rpx 40rpx 30rpx;
			// background-color: #fff;
		}
		.guarantee {
			height: 68rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
			opacity: 1;
			margin: 20rpx 0rpx;
			display: flex;
			align-items: center;
			font-size: 20rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			color: #232323;
		
			.left {
				border: 1px solid #1D93FF;
				margin: 0 30rpx;
				color: #1D93FF;
				padding: 5rpx 10rpx;
			}
		}
		.shopList{
			background: #FFFFFF;
			padding: 15rpx;
			border-radius: 15rpx;
		}

	}
	.footer {
		height: 100rpx;
		background-color: #fff;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		padding: 10rpx 20rpx;
		.btn{
			height: 80rpx;
			background-color: #1e84f1;
			border-radius: 40rpx;
			text-align: center;
			line-height: 80rpx;
			color: #fff;
			font-weight: 600;
		}
		}
</style>